/*
 * @Author: your name
 * @Date: 2022-01-04 19:03:46
 * @LastEditTime: 2022-01-04 21:08:50
 * @LastEditors: LAPTOP-L472H14P
 * @Description: In User Settings Edit
 * @FilePath: \react_front_engineer\src\component\home\detail.js
 */
import React, { Component } from 'react'
// import { useParams } from 'react-router-dom';
import {useNavigate, useLocation} from 'react-router'
 const Detail = ()=>{
    const navigate  = useNavigate();
    function toTheDertail() {
         navigate('/detail', { state: { age: 30 } });
     }
    return (
        <div>
            <button onClick={toTheDertail}>跳转hook</button>
            详情界面
        </div>
      );
}
// export default class Detail extends Component {
//     constructor(props) {
//         super(props);
//         console.log(this)
//       }
//     render() {
//         const {id} = useParams();
//         console.log(this.props);
//         return (
//             <div>
//                 {/* {id} */}
//             </div>
//         )
//     }
// }
export default Detail;